﻿<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ page import="bean.User"%>
<%@ page import="bean.Right"%>
<%@ page import="java.util.List"%>

<%
	User user = (User) request.getSession().getAttribute("user");
	List<Right> type1 = (List) request.getSession().getAttribute("type1");
	List<Right> type2 = (List) request.getSession().getAttribute("type2");
	List<Right> type3 = (List) request.getSession().getAttribute("type3");
	List<Right> type4 = (List) request.getSession().getAttribute("type4");
%>
<!DOCTYPE html>
<!--[if IE 9 ]><html class="ie9"><![endif]-->
<head>
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<meta name="format-detection" content="telephone=no">
<meta charset="UTF-8">

<meta name="description" content="Violate Responsive Admin Template">
<meta name="keywords" content="Super Admin, Admin, Template, Bootstrap">

<title>车辆缉查管理系统</title>

<!-- CSS -->
<link href="zhu/css/bootstrap.min.css" rel="stylesheet">
<link href="zhu/css/animate.min.css" rel="stylesheet">
<link href="zhu/css/font-awesome.min.css" rel="stylesheet">
<link href="zhu/css/form.css" rel="stylesheet">
<link href="zhu/css/calendar.css" rel="stylesheet">
<link href="zhu/css/style.css" rel="stylesheet">
<link href="zhu/css/icons.css" rel="stylesheet">
<link href="zhu/css/generics.css" rel="stylesheet">
</head>
<body id="skin-blur-violate">
	<header id="header" class="media">
		<a href="" id="menu-toggle"></a> <a class="logo pull-left"
			href="toIndex">车辆缉查管理</a>
		<div class="media-body">
			<div class="media" id="top-menu">
				<div id="time" class="pull-right">
					<span id="hours"></span> : <span id="min"></span> : <span id="sec"></span>
				</div>
			</div>
		</div>
	</header>
	<div class="clearfix"></div>
	<section id="main" class="p-relative" role="main">
		<!-- Sidebar -->
		<aside id="sidebar">
			<!-- Sidbar Widgets -->
			<div class="side-widgets overflow">
				<!-- Profile Menu -->
				<div class="text-center s-widget m-b-25 dropdown" id="profile-menu">
					<a href="" data-toggle="dropdown"> <img
						class="profile-pic animated" src="zhu/img/profile-pic.jpg" alt="">
					</a>
					<ul class="dropdown-menu profile-menu">
						<li><a href="logout">登出</a> <i class="icon left">&#61903;</i><i
							class="icon right">&#61815;</i></li>
					</ul>
					<h4 class="m-0"><%=user.getUserName()%></h4>

				</div>

				<!-- Calendar -->
				<div class="s-widget m-b-25">
					<div id="sidebar-calendar"></div>
				</div>


				<!-- Projects -->


				<div class="s-widget-body"></div>
			</div>

			<!-- Side Menu -->
			<ul class="list-unstyled side-menu">
				<li class="active"><a class="sa-side-home" href="toIndex">
						<span class="menu-item">主页</span>
				</a></li>
				<%
					if (!type1.isEmpty()) {
				%>

				<li class="dropdown"><a class="sa-side-ui" href=""> <span
						class="menu-item">卡口系统</span>
				</a>
					<ul class="list-unstyled menu-item">
						<%
							for (Right right : type1) {
						%>
						<li><a href="<%=right.getHref()%>" onclick="loading()"><%=right.getRightName()%></a></li>
						<%
							}
						%>
					</ul></li>
				<li>
					<%
						}
						if (!type2.isEmpty()) {
					%>
				
				<li class="dropdown"><a class="sa-side-widget" href=""> <span
						class="menu-item">车辆缉查</span>
				</a>
					<ul class="list-unstyled menu-item">
						<%
							for (Right right : type2) {
						%>
						<li><a href="<%=right.getHref()%>" onclick="loading()"><%=right.getRightName()%></a></li>
						<%
							}
						%>
					</ul></li>
				<li>
					<%
						}
						if (!type3.isEmpty()) {
					%>
				
				<li class="dropdown"><a class="sa-side-form" href=""> <span
						class="menu-item">资源管理</span>
				</a>
					<ul class="list-unstyled menu-item">
						<%
							for (Right right : type3) {
						%>
						<li><a href="<%=right.getHref()%>" onclick="loading()"><%=right.getRightName()%></a></li>
						<%
							}
						%>
					</ul></li>
				<%
					}
					if (!type4.isEmpty()) {
				%>
				<li class="dropdown"><a class="sa-side-ui" href=""> <span
						class="menu-item">系统管理</span>
				</a>
					<ul class="list-unstyled menu-item">
						<%
							for (Right right : type4) {
						%>
						<li><a href="<%=right.getHref()%>" onclick="loading()"><%=right.getRightName()%></a></li>
						<%
							}
						%>
					</ul> <%
 	}
 %></li>
			</ul>
		</aside>

		<!-- Content -->
		<section id="content" class="container">
			<!-- Messages Drawer -->
			<div id="messages" class="tile drawer animated">
				<div class="listview narrow">
					<div class="overflow" style="height: 254px">
						<div class="media">
							<div class="pull-left">
								<img width="40" src="zhu/img/profile-pics/1.jpg" alt="">
							</div>
						</div>
						<div class="media">
							<div class="pull-left">
								<img width="40" src="zhu/img/profile-pics/2.jpg" alt="">
							</div>
							<div class="media-body">
								<small class="text-muted">David Villa - 5 Hours ago</small><br>
								<a class="t-overflow" href="">Suspendisse in purus ut nibh
									placerat Cras pulvinar euismod nunc quis gravida. Suspendisse
									pharetra</a>
							</div>
						</div>
						<div class="media">
							<div class="pull-left">
								<img width="40" src="zhu/img/profile-pics/3.jpg" alt="">
							</div>
							<div class="media-body">
								<small class="text-muted">Harris worgon - On 15/12/2013</small><br>
								<a class="t-overflow" href="">Maecenas venenatis enim
									condimentum ultrices fringilla. Nulla eget libero rhoncus,
									bibendum diam eleifend, vulputate mi. Fusce non nibh pulvinar,
									ornare turpis id</a>
							</div>
						</div>
						<div class="media">
							<div class="pull-left">
								<img width="40" src="zhu/img/profile-pics/4.jpg" alt="">
							</div>
							<div class="media-body">
								<small class="text-muted">Mitch Bradberry - On
									14/12/2013</small><br> <a class="t-overflow" href="">Phasellus
									interdum felis enim, eu bibendum ipsum tristique vitae.
									Phasellus feugiat massa orci, sed viverra felis aliquet quis.
									Curabitur vel blandit odio. Vestibulum sagittis quis sem sit
									amet tristique.</a>
							</div>
						</div>
						<div class="media">
							<div class="pull-left">
								<img width="40" src="zhu/img/profile-pics/1.jpg" alt="">
							</div>
							<div class="media-body">
								<small class="text-muted">Nadin Jackson - On 15/12/2013</small><br>
								<a class="t-overflow" href="">Ipsum wintoo consectetur urna
									nec tempor adipiscing. Proin sit amet nisi ligula. Sed eu
									adipiscing lectus</a>
							</div>
						</div>
						<div class="media">
							<div class="pull-left">
								<img width="40" src="zhu/img/profile-pics/2.jpg" alt="">
							</div>
							<div class="media-body">
								<small class="text-muted">David Villa - On 16/12/2013</small><br>
								<a class="t-overflow" href="">Suspendisse in purus ut nibh
									placerat Cras pulvinar euismod nunc quis gravida. Suspendisse
									pharetra</a>
							</div>
						</div>
						<div class="media">
							<div class="pull-left">
								<img width="40" src="zhu/img/profile-pics/3.jpg" alt="">
							</div>
							<div class="media-body">
								<small class="text-muted">Harris worgon - On 17/12/2013</small><br>
								<a class="t-overflow" href="">Maecenas venenatis enim
									condimentum ultrices fringilla. Nulla eget libero rhoncus,
									bibendum diam eleifend, vulputate mi. Fusce non nibh pulvinar,
									ornare turpis id</a>
							</div>
						</div>
						<div class="media">
							<div class="pull-left">
								<img width="40" src="zhu/img/profile-pics/4.jpg" alt="">
							</div>
							<div class="media-body">
								<small class="text-muted">Mitch Bradberry - On
									18/12/2013</small><br> <a class="t-overflow" href="">Phasellus
									interdum felis enim, eu bibendum ipsum tristique vitae.
									Phasellus feugiat massa orci, sed viverra felis aliquet quis.
									Curabitur vel blandit odio. Vestibulum sagittis quis sem sit
									amet tristique.</a>
							</div>
						</div>
						<div class="media">
							<div class="pull-left">
								<img width="40" src="zhu/img/profile-pics/5.jpg" alt="">
							</div>
							<div class="media-body">
								<small class="text-muted">Wendy Mitchell - On 19/12/2013</small><br>
								<a class="t-overflow" href="">Integer a eros dapibus,
									vehicula quam accumsan, tincidunt purus</a>
							</div>
						</div>
					</div>
					<div class="media text-center whiter l-100">
						<a href=""><small>VIEW ALL</small></a>
					</div>
				</div>
			</div>

			<!-- Breadcrumb -->
			<ol class="breadcrumb hidden-xs">

				<li class="active"><a href="toIndex">[<%=user.getUserName()%>]
						个人主页
				</a></li>
				<li><a href="logout"> 注销用户</a></li>
			</ol>
			<h4 class="page-title">主页</h4>


			<!-- USA Map -->
			<div class="tile">
				<h2 class="tile-title">地图</h2>
				<div id="container" style="width: 100%; height: 1000px"></div>
			</div>
		</section>


	</section>

	<!-- Javascript Libraries -->
	<!-- jQuery -->
	<script src="zhu/js/jquery.min.js"></script>
	<!-- jQuery Library -->
	<script src="zhu/js/jquery-ui.min.js"></script>
	<!-- jQuery UI -->
	<script src="zhu/js/jquery.easing.1.3.js"></script>
	<!-- jQuery Easing - Requirred for Lightbox + Pie Charts-->

	<!-- Bootstrap -->
	<script src="zhu/js/bootstrap.min.js"></script>

	<!-- Charts -->
	<script src="zhu/js/charts/jquery.flot.js"></script>
	<!-- Flot Main -->
	<script src="zhu/js/charts/jquery.flot.time.js"></script>
	<!-- Flot sub -->
	<script src="zhu/js/charts/jquery.flot.animator.min.js"></script>
	<!-- Flot sub -->
	<script src="zhu/js/charts/jquery.flot.resize.min.js"></script>
	<!-- Flot sub - for repaint when resizing the screen -->

	<script src="zhu/js/sparkline.min.js"></script>
	<!-- Sparkline - Tiny charts -->
	<script src="zhu/js/easypiechart.js"></script>
	<!-- EasyPieChart - Animated Pie Charts -->
	<script src="zhu/js/charts.js"></script>
	<!-- All the above chart related functions -->

	<!-- Map -->
	<script src="zhu/js/maps/jvectormap.min.js"></script>
	<!-- jVectorMap main library -->
	<script src="zhu/js/maps/usa.js"></script>
	<!-- USA Map for jVectorMap -->

	<!--  Form Related -->
	<script src="zhu/js/icheck.js"></script>
	<!-- Custom Checkbox + Radio -->

	<!-- UX -->
	<script src="zhu/js/scroll.min.js"></script>
	<!-- Custom Scrollbar -->

	<!-- Other -->
	<script src="zhu/js/calendar.min.js"></script>
	<!-- Calendar -->
	<script src="zhu/js/feeds.min.js"></script>
	<!-- News Feeds -->

	<!-- gold map -->
	<script type="text/javascript"
		src="http://webapi.amap.com/maps?v=1.3&key=95f288889ad57621de24afb1a1cb10f1&plugin=AMap.Geocoder"></script>

	<!-- All JS functions -->
	<script src="zhu/js/functions.js"></script>
	<script src="js/layer.js"></script>
	<!-- gold  map  -->
	<script type="text/javascript">
		var map = new AMap.Map('container', {
			zoom : 10,
			center : [ 116.39, 39.9 ]
		});
		map.on('click', function(e) {

			var lnglatXY = [ e.lnglat.getLng(), e.lnglat.getLat() ]; //已知点坐标

			function regeocoder() { //逆地理编码
				var geocoder = new AMap.Geocoder({
					radius : 1000,
					extensions : "all"
				});
				geocoder.getAddress(lnglatXY, function(status, result) {
					if (status === 'complete' && result.info === 'OK') {
						geocoder_CallBack(result);
					}
				});
			}

			function geocoder_CallBack(data) {
				var address = data.regeocode.formattedAddress;

				//if(confirm('您在[ '+e.lnglat.getLng()+','+e.lnglat.getLat()+' ]的位置点击了地图！要添加卡口吗？')){
				if (confirm('您在[ ' + address + ' ]的位置点击了地图！要添加卡口吗？')) {
					var marker = new AMap.Marker({
						position : [ e.lnglat.getLng(), e.lnglat.getLat() ],
						map : map
					});
					marker.setMap(map);
					alert("卡口添加成功");
				} else {

				}
			}
			regeocoder();
		});
		function loading() {
			var index = layer.load(1, {
				shade : [ 0.1, '#fff' ]
			//0.1透明度的白色背景
			});
			layer.msg('页面正在加载中,请稍后');
		}
	</script>


</body>
</html>
